#include <iostream>
#include "ShareMemory.h"
using namespace std;
int main(int argc, char** argv) {
  ShareMemory sm1(10);
  for (int index = 0; index < 10; index ++) {
    sm1.write(index, index);
  }
  ShareMemory sm2(6);
  sm2.write(4, -9);
  cout << sm1.read(4) << endl;
  cout << sm2.getSize() << endl;
  ShareMemory sm3(20);
  cout << sm1.getSize() << endl;
  sm1.write(16, 77);
  cout << sm3.read(16) << endl;
  return 0;
}

